package com.cheng.example.atguigu.view3.chapter03;

import lombok.extern.slf4j.Slf4j;

/*
 * @author 程帅
 * @createTime: 2020/11/15 21:10
 * @Created: with IntelliJ IDEA.
 */
@Slf4j
public class Test {

    static final String s = "58tongcheng";

    public static void main(String[] args) {
        String str1 = new StringBuffer("58").append("tongcheng").toString();
        System.out.println(str1);
        System.out.println(str1.intern());
        System.out.println(str1==str1.intern());
//        boolean b1 = str1 == str1.intern();
//        log.info();
//        System.out.println();

        String str2 = new StringBuffer("ja").append("va").toString();
//        System.out.println(str2);
//        System.out.println(str2.intern());
//        System.out.println(str2==str2.intern());
        if (str2 == str2.intern()) {
            log.info("str2 == str2.intern()");
        }
    }
}
